<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var money = 100
      var select1
      var save

      while (1) {
        select1 = prompt(
          "请选择对应的服务项，输入对应数字按回车确定：1，存钱；2.取钱；3.查看余额；4.退出系统"
        )
        if (select1 === "1") {
          save = Number(prompt("存入金额："))
          money += save
          alert("现有余额为" + money)
          continue
        }
        if (select1 === "2") {
          save = Number(prompt("取出金额："))
          money -= save
          alert("现有余额为" + money)
          continue
        }
        if (select1 === "3") {
          alert("现有余额为" + money)
          continue
        }
        if (select1 === "4") {
          alert("谢谢使用！")
          break
        }
      }
    </script>
  </body>
</html>
